<%= toolbar(
  buttons: [
    {
      icon: 'tag_add',
      label: Alchemy.t('New Tag'),
      url: alchemy.new_admin_tag_path,
      title: Alchemy.t('New Tag'),
      hotkey: 'alt+n',
      dialog_options: {
        title: Alchemy.t('New Tag'),
        size: '310x180'
      },
      if_permitted_to: [:create, Alchemy::Tag]
    }
  ]
) %>

<div id="archive_all" class="resources-table-wrapper">
  <h1 class="resources-header">
    <%= @tags.total_count %>
    <%= ActsAsTaggableOn::Tag.model_name.human(count: @tags.total_count) %>
  </h1>
  <% if @tags.any? %>

  <table class="list">
    <thead>
      <tr>
        <th class="icon"></th>
        <th class="name"><%= sort_link(@query, :name, hide_indicator: true) %></th>
        <th class="count"><%= ActsAsTaggableOn::Tag.human_attribute_name(:taggings_types) %></th>
        <th class="count"><%= sort_link(@query, :taggings_count, hide_indicator: true) %></th>
        <th class="tools"></th>
      </tr>
    </thead>
    <tbody>
      <%= render partial: 'tag', collection: @tags %>
    </tbody>
  </table>

  <%= paginate @tags, theme: 'alchemy' %>

  <% else %>

  <%= render_message do %>
    <h2><%= Alchemy.t('No Tags found') %></h2>
    <% if params[:q].blank? %>
      <p><%= Alchemy.t(:tags_get_created_if_used_the_first_time) %></p>
    <% end %>
  <% end %>

  <% end %>
</div>
